<% layout('/layouts/default.html', {title: '人口管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('人口管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('cwl:syrk:cwlSyrkRk:edit')){ %>
					<a href="${ctx}/cwl/syrk/cwlSyrkRk/form" class="btn btn-default btnTool" title="${text('新增人口')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${cwlSyrkRk}" action="${ctx}/cwl/syrk/cwlSyrkRk/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('所属网格名称')}：</label>
					<div class="control-inline">
						<#form:input path="sswgmc" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('居民信息id')}：</label>
				</div>
				<div class="form-group">
					<label class="control-label">${text('公民身份号码编码应符合GB 11643')}：</label>
					<div class="control-inline">
						<#form:input path="gmsfhm" maxlength="18" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('姓名')}：</label>
					<div class="control-inline">
						<#form:input path="xm" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('性别编码应符合GB/T 2261。1')}：</label>
					<div class="control-inline">
						<#form:input path="xb" maxlength="1" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('学历编码应符合GB/T 4658')}：</label>
					<div class="control-inline">
						<#form:input path="xl" maxlength="2" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('联系方式手机或固定电话')}：</label>
					<div class="control-inline">
						<#form:input path="lxfs" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('与户主关系')}：</label>
					<div class="control-inline">
						<#form:input path="yhzgx" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("所属网格名称")}', name:'sswgmc', index:'a.sswgmc', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/cwl/syrk/cwlSyrkRk/form?jmxxid='+row.jmxxid+'" class="btnList" data-title="${text("编辑人口")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("居民信息id")}', name:'jmxxid', index:'a.jmxxid', width:150, align:"left"},
		{header:'${text("公民身份号码编码应符合GB 11643")}', name:'gmsfhm', index:'a.gmsfhm', width:150, align:"left"},
		{header:'${text("姓名")}', name:'xm', index:'a.xm', width:150, align:"left"},
		{header:'${text("性别编码应符合GB/T 2261。1")}', name:'xb', index:'a.xb', width:150, align:"left"},
		{header:'${text("学历编码应符合GB/T 4658")}', name:'xl', index:'a.xl', width:150, align:"left"},
		{header:'${text("联系方式手机或固定电话")}', name:'lxfs', index:'a.lxfs', width:150, align:"left"},
		{header:'${text("与户主关系")}', name:'yhzgx', index:'a.yhzgx', width:150, align:"left"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('cwl:syrk:cwlSyrkRk:edit')){ %>
				actions.push('<a href="${ctx}/cwl/syrk/cwlSyrkRk/form?jmxxid='+row.jmxxid+'" class="btnList" title="${text("编辑人口")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				if (row.status == Global.STATUS_NORMAL){
					actions.push('<a href="${ctx}/cwl/syrk/cwlSyrkRk/disable?jmxxid='+row.jmxxid+'" class="btnList" title="${text("停用人口")}" data-confirm="${text("确认要停用该人口吗？")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
				}
				if (row.status == Global.STATUS_DISABLE){
					actions.push('<a href="${ctx}/cwl/syrk/cwlSyrkRk/enable?jmxxid='+row.jmxxid+'" class="btnList" title="${text("启用人口")}" data-confirm="${text("确认要启用该人口吗？")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
				}
				actions.push('<a href="${ctx}/cwl/syrk/cwlSyrkRk/delete?jmxxid='+row.jmxxid+'" class="btnList" title="${text("删除人口")}" data-confirm="${text("确认要删除该人口吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>